<?php

class ProduitException extends Exception{
    protected  static $logFile='exception.log';
    
    protected function  log ($where, $message) {
        file_put_contents($where, "exception ". date('D, d M Y H:i:s')." ".$message."\n");
    }
    
    public function __construct($message='', $code=0) {
        $this->log(self::$logFile,$message);
        parent::construct($message, $code);
    }
}

?>